package city.spring.modules.medicalstation.doctorsOrder.repository;

import city.spring.modules.medicalstation.doctorsOrder.entity.DoctorsOrderEntity;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * 存储库：医嘱
 *
 * @author 谢金婷
 * @date 2020-11-09 09:46:37
 */
@Repository
public interface DoctorsOrderRepository extends BaseMapper<DoctorsOrderEntity> {
    /**
     * 获取缴存的药品列表
     *
     * @param wrapper 查询对象
     * @return
     */
    List<DoctorsOrderEntity> getOrders(@Param(Constants.WRAPPER) Wrapper<? extends DoctorsOrderEntity> wrapper);

    /**
     * 获取出库的药品列表
     *
     * @param doctorsOrderRecordId 缴存ID
     * @return
     */
    List<DoctorsOrderEntity> getDoctorsOrders(String doctorsOrderRecordId);

    /**
     * 获取出库的某个药品
     *
     * @param doctorsOrderRecordId 缴存ID
     * @param extId                主键ID
     * @return
     */
    DoctorsOrderEntity getDoctorsOrder(String doctorsOrderRecordId, String extId);

}